package com.lh.project.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 
 * @TableName voucher
 */
@TableName(value ="voucher")
@Data
public class Voucher implements Serializable {
    /**
     * 主键
     */
//    @TableId(value = "id", type = IdType.AUTO)
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;

    /**
     * 商铺id
     */
    @TableField(value = "food_id")
    private Long foodId;

    /**
     * 代金券标题
     */
    @TableField(value = "title")
    private String title;

    /**
     * 库存
     */
    @TableField(value = "false")
    private Integer stock;
    /**
     * 副标题
     */
    @TableField(value = "sub_title")
    private String subTitle;

    /**
     * 使用规则
     */
    @TableField(value = "rules")
    private String rules;

    /**
     * 支付金额，单位是分。例如200代表2元
     */
    @TableField(value = "pay_value")
    private Long payValue;

    /**
     * 抵扣金额，单位是分。例如200代表2元
     */
    @TableField(value = "actual_value")
    private Long actualValue;

    /**
     * 0,普通券；1,秒杀券
     */
    @TableField(value = "type")
    private Byte type;

    /**
     * 1,上架; 2,下架; 3,过期
     */
    @TableField(value = "status")
    private Byte status;

    /**
     * 表示秒杀券
     */
    @TableField(exist = false)
    private SeckillVoucher seckillVoucher;

    /**
     * 打折
     */
    @TableField(exist = false)
    private String discount;

    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    private Date createTime;


    /**
     * 开始时间
     */
    @TableField(exist = false)
    private Date BeginTime;

    /**
     * 结束时间
     */
    @TableField(exist = false)
    private Date EndTime;



    /**
     * 更新时间
     */
    @TableField(value = "update_time")
    private Date updateTime;



    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}